<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ page import="java.util.List" %>
<%@ page import="model.SuShe"%>
<%@ page import="dao.SuSheDao"%>  


<%
	//检查会话中是否有 "wy" 属性
	Object fdyObj = session.getAttribute("wy");
	if (fdyObj == null) {
	    response.sendRedirect("../view/Login.jsp");
	    return;
	}
%>
    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>物业查看宿舍配置页面</title>

<link href="../css/Utils.css" rel="stylesheet" type="text/css" />
<link href="../css/List.css" rel="stylesheet" type="text/css" />

<!-- 退出登录专用 -->
   <script type="text/javascript" src="../view/Loginout.js"></script>


</head>
<body>

<!-- 头部 -->
<div class="header" ><br>
<nerong>&nbsp;&nbsp;物业页面&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;</nerong>

 <button onclick="confirmLogout('<%= (String)session.getAttribute("wy") %>','wy')">退出登录</button>
</div><br>

<div class="left" >
<table width="80%" height="80%">
<th>
<nerong>物业可选择内容</nerong>

</th>

</th>
<tr>
<td>
<a href="../View_Msg/msgWy.jsp">&emsp;个人信息</a><br>
</td>
</tr>

<tr>
<td>
<a href="../View_fix/WyFix.jsp">&emsp;报修信息处理</a><br>
</td>
</tr>

<tr>
<td>
<a href = "../View_SuShe/SuSheWyMain.jsp">&emsp;宿舍配置信息管理</a><br>
</td>
</tr>


</table>

</div>



<div class="context" >
<!-- 这部分是每个大功能的小功能 -->
  
            <h2>宿舍配置信息管理</h2>
            
            
            
            	<%
                    	SuSheDao dao = new SuSheDao();                	
                    	List<SuShe> Messages = dao.findParteRoomSuSheData();                                                        
                        if (Messages != null && !Messages.isEmpty()) {
                        	
                 %>   		
                 			            	           	           	                      
            	
                <table class="Alltable">
                    <tr>
                        <th>宿舍号</th>
                        <th>水电费配额</th>
                        <th>宿舍规格</th>
                        <th>操作</th>
                    </tr>
                  
                    <tr>
                       <%    	
                            for (SuShe suShe : Messages) {
                   	%>
                       	<td><%= suShe.getRoomid() %></td>
                        <td><%= suShe.getQuota() %></td>                      
                        <td><%= suShe. getGuige() %></td>                      
                        <td>
                			<button class="btn btn-green" onclick="window.location.href='SuSheWyUpdate.jsp?number=<%= suShe.getRoomid() %>&quota=<%= suShe.getQuota() %>&guige=<%= suShe.getGuige() %>'">
                				<i class="icon-eye"></i> 修改
                			</button>     	             	
                		</td>
                    </tr>
                    <%
                            }
                        } else {
                    %>
                    <tr>
                        <td colspan="3">没有找到对应的宿舍信息</td>
                    </tr>
                    <%
                        }
                    %>
                </table>
                
                
            
     
   

</div>

</body>
</html>